Welcome to Appium Tutorials. Appium is an open-source tool for automating native, mobile web, and hybrid applications on iOS and Android platforms.
In addition to Appium Tutorials, we will cover common interview questions and issues of Appium.
Appium is an open-source tool for automating native, mobile web, and hybrid applications on iOS and Android platforms. Native apps are those written using the iOS or Android SDKs.Mobile web apps are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome or the built-in 'Browser' app on Android). Hybrid apps have a wrapper around a "webview" -- a native control that enables interaction with web content. Projects like Phonegap, make it easy to build apps using web technologies that are then bundled into a native wrapper, creating a hybrid app
If you want to enrich your career and become a professional in Appium, then visit Tekslate - a global online training platform: "Appium Training" This course will help you to achieve excellence in this domain.
Client/Server Architecture Appium is at its heart a web server that exposes a REST API. It receives connections from a client, listens for commands, executes those commands on a mobile device, and responds with an HTTP response representing the result of the command execution. The fact that we have a client/server architecture opens up a lot of possibilities: we can write our test code in any language that has a http client API, but it is easier to use one of the Appium client libraries. We can put the server on a different machine than our tests are running on. We can write test code and rely on a cloud service like Sauce Labs to receive and interpret the commands.
Session Automation is always performed in the context of a session. Clients initiate a session with a server in ways specific to each library, but they all end up sending a POST /session
request to the server, with a JSON object called the 'desired capabilities' object. At this point the server will start up the automation session and respond with a session ID which is used for sending further commands.
Desiredcapabilities Desired capabilities are a set of keys and values (i.e., a map or hash) sent to the Appium server to tell the server what kind of automation session we're interested in starting up. There are also various capabilities which can modify the behavior of the server during automation. For example, we might set the platformName
capability to iOS
to tell Appium that we want an iOS session, rather than an Android one. Or we might set the safariAllowPopups
capability to true
in order to ensure that, during a Safari automation session, we're allowed to use JavaScript to open up new windows. See the capabilities doc for the complete list of capabilities available for Appium.
Appium Server Appium is a server written in Node.js. It can be built and installed from source or installed directly from NPM.
Appium Clients There are client libraries (in Java, Ruby, Python, PHP, JavaScript, and C#) which support Appium's extensions to the WebDriver protocol. When using Appium, you want to use these client libraries instead of your regular WebDriver client. You can view the full list of libraries here.
Appium.app, Appium.exe There exist GUI wrappers around the Appium server that can be downloaded. These come bundled with everything required to run the Appium server, so you don't need to worry about Node. They also come with an Inspector, which enables you to check out the hierarchy of your app. This can come in handy when writing tests.
Checkout Our Frequently Asked Appium Interview Questions
When you download the Appium app you are basically downloading the server. The server is written in Node.js and implements the Selenium WebDriver. It allows one to use available WebDriver client to fire your tests. And then your mobile app acts precisely like a web app where the DOM is represented by View hierarchy.
So this server basically exposes REST api which performs the following actions.
Receives connection from client
Listen command
Execute command
Respond back the command execution status
On an iOS device, Appium uses Apple's UIAutomation API to interact with the UI elements. UI Automation is a JavaScript library provided by Apple to write test scripts; Appium utilizes these same libraries to automate iOS apps.
In diagram, when we execute the test scripts, it goes in the form of JSON through an HTTP request to the Appium server. The Appium server sends the command to the instruments, and the instruments look for the bootstrap.js
file, which is pushed by the Appium server to the iOS device. Then, these commands execute in the bootstrap.js file
within the iOS instruments' environment. After the execution of the command, the client sends back the message to the Appium server with the log details of the executed command.
On an Android device, Appium uses the UIAutomator framework to automate the apps. UI Automator is a framework that is developed by the Android developers to test the Android user interface.
In the preceding diagram, we have a UIAutomator/Selendroid in place of Apple instruments and bootstrap.jar
in place of the bootstrap.js
file.
Appium supports Android versions greater than or equal to 17; for earlier versions, it uses the Selendroid framework. When we execute the test scripts, Appium sends the command to the UIAutomator or Selendroid on the basis of the Android version.
Here, bootstrap.jar
plays the role of a TCP server, which we can use to send the test command in order to perform the action on the Android device using UIAutomator/Selendroid.
There are few limitation in appium right now.
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.